package com.controller;

import com.pojo.MenuBean;
import com.server.MenuService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class MenuController {//处理菜单相关的请求
    @Resource
    MenuService menuService;

    //获取菜单
    @GetMapping("/getMenuList")
    @ResponseBody
    public Object getMenuList(int rolePid) {
        List<MenuBean> menuBeans = null;
        menuBeans = menuService.getMenuList(rolePid);
        menuBeans.forEach(System.out::println);
//        return JSON.toJSONString(menuBeans);
        return menuBeans;
    }

}
